/**
 * 随机生成颜色的函数，不包含白色
 */
type ColorMap = {
  [key: string]: string;
};
export const getLanguageColor = (language: string): string => {
  const colors: ColorMap = {
    "JavaScript": "#f1e05a",
    "HTML": "#e34c26",
    "CSS": "#563d7c",
    "Java": "#b07219",
    "Python": "#3572a5",
    "Ruby": "#701516",
    "PHP": "#4f5d95",
    "C++": "#f34b7d",
    "C": "#555555",
    "Shell": "#89e051",
    "TypeScript": "#2b7489",
    "Swift": "#ffac45",
    "Objective-C": "#438eff",
    "Go": "#00add8",
    "Vue": "#41b883",
    "Scala": "#c22d40",
    "Kotlin": "#f18e33",
    "Rust": "#dea584",
    "Dart": "#00b4ab",
    "Perl": "#0298c3",
    "Lua": "#000080",
    "Haskell": "#5e5086",
    "Elixir": "#6e4a7e",
    "CoffeeScript": "#244776",
    "Clojure": "#db5855",
    "TeX": "#3d6117",
    "Groovy": "#4298b8",
    "Vim script": "#199f4b",
    "PowerShell": "#012456",
    "Assembly": "#6E4C13",
    "OCaml": "#3be133",
    "D": "#ba595e",
    "R": "#198ce7",
    "Matlab": "#e16737",
    "ActionScript": "#882b0f",
    "Perl 6": "#0000fb",
    "Visual Basic": "#945db7",
    "Objective-C++": "#6866fb",
    "F#": "#b845fc",
    "ClojureScript": "#7fce36",
    "Racket": "#22228f",
    "Erlang": "#B83998",
    "Crystal": "#000100",
    "SAS": "#B34936",
    "Arduino": "#bd79d1",
    "Verilog": "#b2b7f8",
    "Factor": "#636746",
    "Elm": "#60B5CC",
    "PureScript": "#1D222D",
    "WebAssembly": "#04133b",
    "Haxe": "#df7900",
    "Visual Basic .NET": "#945db7",
    "XSLT": "#EB8CEB",
    "Groff": "#ecdebe",
    "AGS Script": "#B9D9FF",
    Dockerfile: "#384d54",
    JSONiq: "#40d47e",
    SQLPL: "#e2bcff",
    Gherkin: "#5B2063",
    Eagle: "#814C05",
    "Jupyter Notebook": "#DA5B0B",
    MoonScript: "#ff4585",
    Nim: "#ffc200",
    "Objective-J": "#ff0c5a",
    Roff: "#ecdebe",
    Ragel: "#9d5200",
    Pascal: "#E3F171",
    Runoff: "#665a4e",
    Gnuplot: "#f0a9f0",
    Forth: "#341708",
    Hy: "#7790B2",
    SuperCollider: "#46390b",
    J: "#9EEDFF",
    Mask: "#f97732",
    "Emacs Lisp": "#c065db",
    VCL: "#148AA8",
    Puppet: "#302B6D",
    "ActionScript 3.0": "#e3491a",
    Diff: "#88dddd",
    Rascal: "#fffaa0",
    Mercury: "#ff2b2b",
    Metal: "#8f14e9",
    CMake: "#DA3434",
    Chapel: "#8dc63f",
    Turing: "#cf142b",
    "F*": "#572e30",
    "Standard ML": "#dc566d",
    Pawn: "#dbb284",
    XQuery: "#5232e7",
    "Common Lisp": "#3fb68b",
    Xtend: "#24255d",
    Nimrod: "#37775b",
    SystemVerilog: "#DAE1C2",
    Golo: "#88562A",
    Dylan: "#6c616e",
    PogoScript: "#d80074",
    sed: "#64b970",
    PLSQL: "#dad8d8",
    ATS: "#1ac620",
    Ada: "#02f88c",
    Nu: "#c9df40",
    LFE: "#004200",
    Oxygene: "#cdd0e3",
    ASP: "#6a40fd",
    PostScript: "#da291c",
    Logos: "#AAAAFF",
    nesC: "#94B0C7",
    Max: "#c4a79c",
    MQL4: "#62A8D6",
    "Ren'Py": "#ff7f7f",
    GAMS: "#f49a22",
    NetLinx: "#0aa0ff",
    Squirrel: "#800000",
    SMT: "#c95700",
    Zephir: "#118f9e",
    VimL: "#199f4b",
    Stan: "#b2011d",
    U: "#008cc8",
    Clarion: "#db901e",
    Pike: "#005390",
    LOLCODE: "#cc9900",
    ooc: "#b0b77e",
    Handlebars: "#01a9d6",
    Idris: "#b30000",
    Yacc: "#4B6C4B",
    Dogescript: "#cca760",
    Opa: "#0598c8",
    ECL: "#8a1267",
    Zimpl: "#d67711",
    wdl: "#42f1f4",
    Prolog: "#74283c",
    Cuda: "#3A4E3A",
    Gosu: "#82937f",
    Fancy: "#7b9db4",
    ANTLR: "#9DC3FF",
    QML: "#44a51c",
    Monkey: "#c06c84",
    AMPL: "#E6EFBB",
    Lasso: "#999999",
    E: "#ccce35",
    Scilab: "#ca0f19",
    VHDL: "#adb2cb",
    Io: "#a9188d",
    Slash: "#007eff",
    ZIL: "#dc75e5",
    "Common Workflow Language": "#B5314C",
    Click: "#E4E6F3",
    "SRecode Template": "#348a34",
  };
  const defaultColor = "#cccccc";
  return colors[language] || defaultColor;
};
